import { Login } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { obj2fd } from "@/utils/index";
import http from "@/api";
// 查询列表
export const getDataByPageByMac = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/blackMacList/${params?.pageNum}/${params?.pageSize}/${params?.mac || "0"}/${params?.startTime || "0"}/${params?.endTime || "0"}`); // 正常 post json 请求  ==>  application/json
};
// 新增
export const addDataByMac = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/blackMacAdd`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editDataByMac = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/blackMacUpdate`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 删除列表
export const deleteDataByMac = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/blackMacDel`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 查询列表
export const getDataByPageByIp = (params: object) => {
  return http.post<Login.ResLogin>(
    PORT1 +
      `/safe/ipgroup/ipgroup_list/${params?.pageNum || "0"}/${params?.pageSize || "0"}/${params?.ip || "0"}/${params?.startTime || "0"}/${params?.endTime || "0"}`
  ); // 正常 post json 请求  ==>  application/json
};
// 新增
export const addDataByIp = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/blackIpAdd`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editDataByIp = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/blackIpUpdate`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 删除列表
export const deleteDataByIp = (params: object) => {
  return http.post<Login.ResLogin>(PORT1 + `/secure/blackIpDel`, obj2fd(params), { loading: false }); // 正常 post json 请求  ==>  application/json
};
